<template>
  <div class="xiangqing1">
    <head_><h1>订单详情</h1></head_>
    <p class="dingdanhao">
      <span>订单号：{{list.orderNumber}}</span> <br/>
    </p>
    <xinxi_></xinxi_>

    <p class="xiangqing_day">
      预约取车时间：<span >{{list.subscribePickTime}}</span> <br/>
      预约还车时间：<span >{{list.subscribeReturnTime}}</span>
      预计租车时长：<span v-text="dates"></span> 天 <br/>
      实际取车时间：<span >{{list.actualPickTime}}</span> <br/>
      实际还车时间：<span >{{list.actualReturnTime}}</span>
      实际租车时长：<span v-text="datesActual"></span> 天 <br/>
      取车门店：<span >{{list.pickStore}}</span>
      还车门店：<span >{{list.returnStore}}</span>
    </p>
    <xiangqing1_total :orderCost="list.orderCost"></xiangqing1_total>
  </div>
</template>
<script>
import head_ from "../header";
import xinxi_ from "./ordercheliangxinxi";
import xiangqing1_total from "./xiangqing1_total";
import {getOrderInfo} from '../../../request/order/order.js';
export default {
  props: {},
  data() {
    return {
      list: [],
      dates: null,
      datesActual: ''
    };
  },
    methods: {

    },
    created(){

    },
  components: { head_, xinxi_, xiangqing1_total },
  beforeMount(){
      // 获取我的订单
      getOrderInfo({
          "orderId":this.$route.params.childlist
      }).then( result => {
          console.log(result);
          this.list = result.object;
          console.log(this.list);
          this.$store.state.carinfo = this.list;
          let start = new Date(this.list.subscribePickTime);
          let end = new Date(this.list.subscribeReturnTime);
          this.dates = Math.ceil((end-start)/1000/60/60/24);//预计租车时长
          let startActual = new Date(this.list.actualPickTime);
          let endActual = new Date(this.list.actualReturnTime);
          this.datesActual = Math.ceil((startActual-endActual)/1000/60/60/24);//实际租车时长
          this.$store.state.pingjiacarid = this.list.carId;
      });
        this.childlist = JSON.parse(this.$route.params.childlist)
  }
};
</script>

<style scoped lang="less">
.xinxi {
  margin-top: 0;
  div {
    div:nth-child(2) {
      p {
        position: relative !important;
      }
      p:nth-child(1) {
        top: 0.4rem !important;
      }
      p:nth-child(2) {
        top: -0.3rem !important;
      }
    }
  }
}
.xiangqing1 {
  width: 100%;
  font-size: 0.12rem;
  .dingdanhao {
    font-size: 0.23rem;
    color: #666666;
    display: flex;
    justify-content: space-between;
    padding: 0 0.29rem 0 0.38rem;
    height: 0.94rem;
    line-height: 0.94rem;
  }
}
.xiangqing_day {
  width: 100%;
  height: 4.0rem;
  border-top: 0.01rem solid #e0e0e0;
  border-bottom: 0.01rem solid #e0e0e0;
  font-size: 0.23rem;
  color: #666666;
  padding-left: 0.38rem;
  line-height: 0.8rem;
  span {
    font-size: 0.20rem;
    color: #333333;
    font-weight: 600;
  }
}
</style>
